# -*- coding: utf-8 -*-
"""
@Time ： 2023/10/16 21:44
@Auth ： y.h
@File ：del_row_or_col_properties.py
@IDE ：PyCharm
@Motto：The sooner you start to code, the longer the program will take. —— Roy Carlson
"""
import pandas


class 删除行或列配置文件:
    __df = None

    __row_name = []
    __row_index = []

    __col_name = []
    __col_index = []

    def get_row_name(self):
        return self.__row_name

    def 配置行名称(self, row_name):
        self.__row_name = []
        if type(row_name) == type(list()):
            self.__row_name.extend(row_name)
        else:
            self.__row_name.append(row_name)
        return self

    def get_row_index(self):
        return self.__row_index

    def 配置行索引(self, row_index):
        self.__row_index = []
        if type(row_index) == type(list()):
            self.__row_index.extend(row_index)
        else:
            self.__row_index.append(row_index)
        return self

    def get_col_name(self):
        return self.__col_name

    def 配置列名称(self,col_name):
        self.__col_name = []
        if type(col_name) == type(list()):
            self.__col_name.extend(col_name)
        else:
            self.__col_name.append(col_name)
        return self.__col_name

    def get_col_index(self):
        return self.__col_index

    def 配置列索引(self,col_index):
        self.__col_index = []
        if type(col_index) == type(list()):
            self.__col_index.extend(col_index)
        else:
            self.__col_index.append(col_index)
        return self.__col_index

    def get_df(self):
        return self.__df

    def 配置数据集(self,df):
        self.__df = None
        if type(df) != type(pandas.DataFrame()):
            print(f"数据集添加错误!需要{type(pandas.DataFrame())},传入的数据为{type(df)}!")
            exit(True)
        else:
            self.__df = df

        return self

